<?php
class common_media_config {
	
	public static $sizes = array('64' => 'small', '200' => 'thumb', '640' => 'middle', '1200' => 'large');
	public static $imageFilter = array('jpg', 'png', 'gif87', 'gif89');
	
	/**
	 * 写成一个方法，方便多域名轮播
	 */
	public static function imageHttp() {
		return 'http://resource.hihicar.com/image';
	}
	
	public static function noImage() {
		return 'http://resource.hihicar.com/image/noimage.jpg';
	}
	
	/**
	 * 路径算法 $code -> 32位 md5
	 */
	public static function md5Path($code) {
		$filename = substr($code, 8, 16);
		$file = '/' . substr($filename, 0, 1) . '/' . substr($filename, 8, 1);
		return $file . '/' . $filename;
	}
	
	public static function imagePath() {
		return _DIRECTORY_VAR . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'web' . DIRECTORY_SEPARATOR . 'resource' . DIRECTORY_SEPARATOR . 'image';
	}
	
}